package com.jiaai.cloud.gift.service.impl;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.jiaai.cloud.base.page.CustomPage;
import com.jiaai.cloud.gift.entity.TLiveGift;
import com.jiaai.cloud.gift.mapper.TLiveGiftMapper;
import com.jiaai.cloud.gift.service.ITLiveGiftService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 直播间礼物设置 服务实现类
 * </p>
 *
 * @author 佳爱网络科技
 * @since 2017-08-01
 */
@Service
public class TLiveGiftServiceImpl extends ServiceImpl<TLiveGiftMapper, TLiveGift> implements ITLiveGiftService {

    @Autowired
    private TLiveGiftMapper tLiveGiftMapper;

    @Override
    public CustomPage findGiftFully(Page page, @Param("ew") Wrapper wrapper) {
        page.setRecords(baseMapper.findGiftFully(page,wrapper));
        return new CustomPage(page);
    }

    @Override
    public List<Map<String, Object>> selectGiftCount() {
        return baseMapper.selectGiftCount();
    }

    @Override
    public List<Map<String, Object>> selectGiftMoneyCount() {
        return baseMapper.selectGiftMoneyCount();
    }

    @Override
    public List<Map<String, Object>> selectGiftDataCount() {
        return baseMapper.selectGiftDataCount();
    }

    @Override
    public void updateOne(TLiveGift tLiveGift) {
        tLiveGiftMapper.updateOne(tLiveGift);
    }
}
